#include <stdio.h>

using namespace std;

#define MAXN (15 + 5)
int N;
int A[MAXN], Mask[MAXN];
int MaxLen = -1;

void Read() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &A[i]);
  }
}

void Solve(int cur) {
  if (cur == N) {
    int sums[2] = {0};
    for (int i = 0; i < N; ++i) {
      if (Mask[i] != -1) {
        // 第i根棍子被分到哪一堆。
        sums[Mask[i]] += A[i];
      }
    }
    if (sums[0] == sums[1]) {
      if (sums[0] > MaxLen) {
        MaxLen = sums[0];
      }
    }
    return;
  }

  const int choices[] = {-1, 0, 1};
  for (int i = 0; i < 3; ++i) {
    Mask[cur] = choices[i];
    Solve(cur + 1);
  }
}

int main() {
//   freopen("in2.txt", "r", stdin);
  Read();
  Solve(0);
  printf("%d\n", MaxLen);

  return 0;
}